package com.kin207.netty.msg.decoder;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.kin207.netty.util.ByteTools;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class HexMessageEncoder extends MessageToByteEncoder<String> {
	final static Logger logger = LoggerFactory.getLogger(HexMessageEncoder.class);
	@Override
	protected void encode(ChannelHandlerContext ctx, String msg, ByteBuf out) throws Exception {
		out.writeBytes(ByteTools.hexStringToBytes(msg));
	}
	

}
